package com.zys.exercise;

import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class text2 {
    public static void main(String[] args) throws IOException {

        String net = "https://news.qq.com/rain/a/20250424A06JE400";
        String s = webCrawler(net);
        System.out.println(s);


    }
    public static String webCrawler(String net) throws IOException {
        StringBuilder s = new StringBuilder();
        URL url = new URL(net);
        URLConnection conn = url.openConnection();
        InputStreamReader isr = new InputStreamReader(conn.getInputStream());
        int ch;
        while ((ch=isr.read())!=-1){
            s.append((char)ch);
        }
        isr.close();
        return s.toString();


    }
}
